package day01;

//输入n计算1~n 全部连接起来的长度(n分别取100,100000,100000000,100000000000000)
public class JoinNumbers2 {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        int n = 10000000;
        StringBuffer s = new StringBuffer();
        System.out.println(s);
        for (int i = 1; i <= n; i++) {
            s.append(i);
        }
        System.out.println(s.length());


        long end = System.currentTimeMillis();


        System.out.println((end - start) / 1000.0 + " second(s).");
    }
}
